import { TreeItem } from '/@/components/Tree/index';

import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { useUserStore } from '/@/store/modules/user';
import dayjs from 'dayjs';
//列表数据
export const columns: BasicColumn[] = [
  {
   title: 'id',
   align:"center",
   dataIndex: 'id'
  },
  {
   title: '订单编号',
   align:"center",
   dataIndex: 'orderNo'
  },
  {
    title: '订单标题',
    align:"center",
    dataIndex: 'title'
   },
  // {
  //  title: '用户id',
  //  align:"center",
  //  dataIndex: 'userId'
  // },
  // {
  //  title: '支付产品id',
  //  align:"center",
  //  dataIndex: 'productId'
  // },
  {
   title: '订单金额',
   align:"center",
   dataIndex: 'totalFee',
   width: 80,
  },
  {
   title: '订单状态',
   align:"center",
   dataIndex: 'orderStatus'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'orderNo',
    label: '订单编号',
    component: 'Input',
    defaultValue: '',
    colProps: { span: 8, },
  },
];

//账单查询数据
export const billFormSchema: FormSchema[] = [
  {
    field: 'billDate',
    label: '日期',
    component: 'DatePicker',
    componentProps: {
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
    },
    defaultValue: dayjs(),
    required: true,
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '商品列表',
    field: 'productId',
    required: true,
    component: 'RadioButtonGroup',
    defaultValue: '1',
    componentProps: {
      options: [
        {
          label: '草莓大圣代',
          value: '1',
        },
        {
          label: '冰鲜柠檬水',
          value: '2',
        },
        {
          label: '外婆烧仙草',
          value: '3',
        },
      ],
    },
  },
  {
    field: 'title',
    label: '商品名称',
    component: 'Input',
    defaultValue: '魅雪冰城',
    dynamicDisabled: true,    //禁用
  },
  {
    field: 'note',
    label: '商品介绍',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '经典回归，奥利奥饼干风味',
    },
  },
  {
    field: 'amount',
    label: '价格',
    component: 'Input',
    defaultValue: '0.01',
    renderComponentContent: () => {
      return {
        prefix: () => '￥：',
      };
    },
  },
  {
    label: '支付方式',
    field: 'payType',
    required: true,
    component: 'RadioButtonGroup',
    componentProps: {
      options: [
        {
          label: '微信支付',
          value: 'wxpay',
        },
        {
          label: '支付宝',
          value: 'alipay',
        },
      ],
    },
    defaultValue: 'wxpay',
  },
];
